package cn.xinfei.xdecision.common.model.enginex.po;

import com.baomidou.mybatisplus.annotation.*;
import lombok.*;
import lombok.extern.slf4j.Slf4j;

import java.io.Serializable;

@Slf4j
@Data
@TableName("t_engine_node")
@Builder
@AllArgsConstructor
@NoArgsConstructor
@ToString(callSuper = true)
public class EngineNode implements Serializable {

    private static final long serialVersionUID = -1867357850853531748L;
    /**
     * 节点信息编号
     */
    @TableId(type = IdType.AUTO)
    private Long id;

    /**
     * 版本编号
     */
    private Long versionId;

    /**
     * 节点名称
     */
    private String nodeName;

    /**
     * 节点代号
     */
    private String nodeCode;

    /**
     * 节点顺序
     */
    private Integer nodeOrder;

    /**
     * 节点类型
     */
    private String nodeType;

    /**
     * 节点信息
     */
    private String nodeJson;

    /**
     * 节点横坐标
     */
    private Double nodeX;

    /**
     * 节点纵坐标
     */
    private Double nodeY;

    /**
     * 节点脚本
     */
    private String nodeScript;

    /**
     * 下个节点(可能是多个)
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String nextNodeCodes;

    /**
     * 上一个节点的id，多个节点逗号分隔
     */
    @TableField(updateStrategy = FieldStrategy.IGNORED)
    private String parentId;

    /**
     * 是否删除
     */
    @TableLogic
    private Boolean deleted;

    /**
     * 决策流运行中的版本的code
     */
    @TableField(exist = false)
    private String engineCode;


    /**
     * 决策流运行中的版本
     */
    @TableField(exist = false)
    private String engineVersion;

    private String fieldCodes;

	/**
	 * 节点标记，仅在部署上线时更新该值
	 */
	private Integer nodeTags;



    public String toSimpleString() {
        return "EngineNode{" +
                "id=" + id +
                ", versionId=" + versionId +
                ", nodeName='" + nodeName + '\'' +
                ", nodeCode='" + nodeCode + '\'' +
                ", nodeOrder=" + nodeOrder +
                ", nodeType='" + nodeType + '\'' +
                ", nextNodeCodes='" + nextNodeCodes + '\'' +
                ", parentId='" + parentId + '\'' +
                ", deleted=" + deleted +
                ", engineCode='" + engineCode + '\'' +
                ", engineVersion='" + engineVersion + '\'' +
                ", fieldCodes='" + fieldCodes + '\'' +
                '}';
    }
}